package calorie.com.calorie.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lxh.baselibray.net.ServiceGenerator;

import java.util.List;

import calorie.com.calorie.R;
import calorie.com.calorie.response.GoodsOrderResponce;

/**
 * Created by chenxi on 2019/4/11.
 */
//已发货
public class MallWaitSureAdapter extends BaseQuickAdapter<GoodsOrderResponce.DataBean.OrderListBean,BaseViewHolder> {
    public MallWaitSureAdapter(int layoutResId, @Nullable List<GoodsOrderResponce.DataBean.OrderListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsOrderResponce.DataBean.OrderListBean item) {
        ImageView goodsPic = helper.getView(R.id.goods_pic);
        Glide.with(mContext).load(ServiceGenerator.BASE_URL + ":9023/image/"+item.getImgUrl()).into(goodsPic);

        helper.setText(R.id.goods_name,item.getTitle())
                .setText(R.id.goods_price,""+item.getAmount());
        helper.addOnClickListener(R.id.order_wait_sure_item);//公用一个事件
        helper.addOnClickListener(R.id.confirm_receipt);
    }
}
